import request from './request'

export const getuser = (params) => {
  return request({
    url: '/api/admin/users',
    method: 'GET',
    params
  })
}

// 名字查询用户
export const getuserfromusername = (params) => {
  return request({
    url: '/api/admin/user/' + params,
    method: 'GET',
    params
  })
}

// 修改用户状态
export const edituserstatus = (uid) => {
  return request({
    url: `/api/admin/user/${uid}`,
    method: 'PUT'
  })
}

// 删除用户
export const deleteuser = (uid) => {
  return request({
    url: `/api/admin/user/${uid}`,
    method: 'DELETE'
  })
}

// 添加用户
export const adduser = (data) => {
  return request({
    url: '/api/studentRegister',
    method: 'POST',
    data
  })
}

// 修改用户信息
export const edituser = (data) => {
  return request({
    url: '/api/admin/user',
    method: 'PUT',
    data
  })
}

// 个人信息

export const mydata = () => {
  return request({
    url: '/api/leader/user',
    method: 'GET'
  })
}
